<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>一个网页</title>
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
</head>
<body>
<!--<form id="form1">-->
<input type="file" name="files" id="fileinput" multiple=""/>
<!-- </form> -->
<button type="button" id="test1">上传图片</button>
<script>
    $(function () {
        $("#test1").click(function (e) {
            var formData = new FormData();
            var ffff = $('#fileinput')[0].files;
            for (var i = ffff.length - 1; i >= 0; i--) {
                formData.append("files", ffff[i]);
            }
            var ooo = formData.get('files');
            $.ajax({
                type: "post",
                dataType: "json",
                url: 'http://192.168.1.185:8086/bweixin/v1.0/util/upload', //上传接口
                data: formData,
                processData: false,
                contentType: false,
                //                  contentType:"multipart/form-data",
                success: function (data) {
                    console.log(data);
                    alert("成功");
                },
                error: function (msg) {
                    console.log(msg);
                }
            });
        });

    });
</script>
</body>
</html>